package org.dromara.todolist.controller;

import org.dromara.common.core.validate.QueryGroup;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController;
import org.dromara.todolist.domain.bo.TdDemoBo;
import org.dromara.todolist.domain.vo.TdDemoVo;
import org.dromara.todolist.service.ITdDemoService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.dev33.satoken.annotation.SaIgnore;
import lombok.RequiredArgsConstructor;

/**
 * 测试单表Controller
 *
 * @author jy.chen
 */
@Validated
@RequiredArgsConstructor
@RestController
@SaIgnore
@RequestMapping("/td/demo")
public class TdDemoController extends BaseController {

    private final ITdDemoService tdDemoService;

    /**
     * 查询测试单表列表
     *
     * @param bo 查询条件对象
     * @param pageQuery 分页对象
     * @return {@link TableDataInfo}
     */
    @GetMapping("/list")
    public TableDataInfo<TdDemoVo> list(@Validated(QueryGroup.class) TdDemoBo bo, PageQuery pageQuery) {
        return tdDemoService.queryPageList(bo, pageQuery);
    }
}
